﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;

#nullable disable

#pragma warning disable CA1814 // Prefer jagged arrays over multidimensional

namespace Wallpaper.Data.Migrations
{
    /// <inheritdoc />
    public partial class UpdateTableField : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "10506d2a-36f0-4c35-a0b0-e34344cacc4f");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "11a967b4-2289-4179-bb1e-50df3973d1df");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "14e108ef-caa2-4733-b8b8-aac1184bf945");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "277cb688-abaa-4091-8bb1-b86663c220dd");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "2c02a95d-21cc-44df-a572-9b643ecc9966");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "2dbc5a5b-3d6f-4a76-98f6-9cac30c7a0b4");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "368df1ec-0a1b-4b4a-9c8c-9014d00e18bf");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "497620cb-0d9b-418e-ba73-06b9cbedcf36");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "66b4e109-d861-4608-9ee5-8dd84730bd8b");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "9812bcd0-3249-4c01-8dd1-5a09333237c1");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "b09e957b-4da7-4226-91f9-79770bbb9a02");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "b70f521b-5853-4421-bb9a-54fe4256f144");

            migrationBuilder.DeleteData(
                table: "roles",
                keyColumn: "Id",
                keyValue: "756d7b3a-46f0-44d8-8b3f-10542534f64a");

            migrationBuilder.DeleteData(
                table: "roles",
                keyColumn: "Id",
                keyValue: "81161183-3635-47a8-bb81-06f9bd23e001");

            migrationBuilder.DeleteData(
                table: "roles",
                keyColumn: "Id",
                keyValue: "aa1caf86-ab44-4197-b463-8b3e329f017f");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "37a02ef9-23e0-40f6-af12-1d8913ac0d4f");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "3ea3e877-7c9d-4158-b671-1eac55a7ba48");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "c2e9bdc6-be4d-4c36-ad28-932c0ac71945");

            migrationBuilder.DeleteData(
                table: "menus",
                keyColumn: "Id",
                keyValue: "cfaa92ac-2cac-4c7a-9fac-368f17a8df7e");

            migrationBuilder.DropColumn(
                name: "UpdateAt",
                table: "roles");

            migrationBuilder.DropColumn(
                name: "UpdateAt",
                table: "menus");

            migrationBuilder.RenameColumn(
                name: "CreateAt",
                table: "roles",
                newName: "CreatedAt");

            migrationBuilder.RenameColumn(
                name: "CreateAt",
                table: "menus",
                newName: "CreatedAt");

            migrationBuilder.RenameColumn(
                name: "category_url",
                table: "categories",
                newName: "CategorylUrl");

            migrationBuilder.RenameColumn(
                name: "is_active",
                table: "categories",
                newName: "IsEnabled");

            migrationBuilder.RenameColumn(
                name: "is_active",
                table: "carousels",
                newName: "IsEnabled");

            migrationBuilder.RenameColumn(
                name: "Status",
                table: "admins",
                newName: "IsEnabled");

            migrationBuilder.AddColumn<bool>(
                name: "IsEnabled",
                table: "wallpapers",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "IsEnabled",
                table: "users",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "tags",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdatedAt",
                table: "roles",
                type: "datetime2",
                nullable: true,
                comment: "更新时间");

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdatedAt",
                table: "menus",
                type: "datetime2",
                nullable: true,
                comment: "更新时间");

            migrationBuilder.AddColumn<bool>(
                name: "IsDeleted",
                table: "carousels",
                type: "bit",
                nullable: false,
                defaultValue: false);

            migrationBuilder.AddColumn<bool>(
                name: "IsSuperAdmin",
                table: "admins",
                type: "bit",
                nullable: false,
                defaultValue: false);
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropColumn(
                name: "IsEnabled",
                table: "wallpapers");

            migrationBuilder.DropColumn(
                name: "IsEnabled",
                table: "users");

            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "tags");

            migrationBuilder.DropColumn(
                name: "UpdatedAt",
                table: "roles");

            migrationBuilder.DropColumn(
                name: "UpdatedAt",
                table: "menus");

            migrationBuilder.DropColumn(
                name: "IsDeleted",
                table: "carousels");

            migrationBuilder.DropColumn(
                name: "IsSuperAdmin",
                table: "admins");

            migrationBuilder.RenameColumn(
                name: "CreatedAt",
                table: "roles",
                newName: "CreateAt");

            migrationBuilder.RenameColumn(
                name: "CreatedAt",
                table: "menus",
                newName: "CreateAt");

            migrationBuilder.RenameColumn(
                name: "CategorylUrl",
                table: "categories",
                newName: "category_url");

            migrationBuilder.RenameColumn(
                name: "IsEnabled",
                table: "categories",
                newName: "is_active");

            migrationBuilder.RenameColumn(
                name: "IsEnabled",
                table: "carousels",
                newName: "IsActive");

            migrationBuilder.RenameColumn(
                name: "IsEnabled",
                table: "admins",
                newName: "Status");

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdateAt",
                table: "roles",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified));

            migrationBuilder.AddColumn<DateTime>(
                name: "UpdateAt",
                table: "menus",
                type: "datetime2",
                nullable: false,
                defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified),
                comment: "更新时间");

            migrationBuilder.InsertData(
                table: "menus",
                columns: new[] { "Id", "Component", "CreateAt", "Icon", "IsEnabled", "Name", "ParentId", "Path", "Sort", "UpdateAt" },
                values: new object[,]
                {
                    { "37a02ef9-23e0-40f6-af12-1d8913ac0d4f", null, new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1937), "DataLine", true, "数据统计", null, null, 4, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "3ea3e877-7c9d-4158-b671-1eac55a7ba48", null, new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1900), "Setting", true, "系统管理", null, null, 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "497620cb-0d9b-418e-ba73-06b9cbedcf36", "dashboard/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1877), "House", true, "仪表盘", null, "/dashboard", 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "c2e9bdc6-be4d-4c36-ad28-932c0ac71945", null, new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1925), "Document", true, "内容管理", null, null, 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "cfaa92ac-2cac-4c7a-9fac-368f17a8df7e", null, new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1945), "Tools", true, "系统工具", null, null, 5, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }
                });

            migrationBuilder.InsertData(
                table: "roles",
                columns: new[] { "Id", "CreateAt", "Description", "IsEnabled", "RoleCode", "RoleName", "UpdateAt" },
                values: new object[,]
                {
                    { "756d7b3a-46f0-44d8-8b3f-10542534f64a", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(5864), "系统超级管理员，拥有所有权限", true, "super_admin", "超级管理员", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "81161183-3635-47a8-bb81-06f9bd23e001", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(5885), "负责审核和管理的壁纸的角色", true, "wallpaper_auditor", "壁纸审核员", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "aa1caf86-ab44-4197-b463-8b3e329f017f", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(5882), "系统管理员", true, "admin", "管理员", new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }
                });

            migrationBuilder.InsertData(
                table: "menus",
                columns: new[] { "Id", "Component", "CreateAt", "Icon", "IsEnabled", "Name", "ParentId", "Path", "Sort", "UpdateAt" },
                values: new object[,]
                {
                    { "10506d2a-36f0-4c35-a0b0-e34344cacc4f", "tools/backup/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1956), "DataAnalysis", true, "数据备份", "cfaa92ac-2cac-4c7a-9fac-368f17a8df7e", "/tools/backup", 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "11a967b4-2289-4179-bb1e-50df3973d1df", "tools/log/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1947), "List", true, "系统日志", "cfaa92ac-2cac-4c7a-9fac-368f17a8df7e", "/tools/log", 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "14e108ef-caa2-4733-b8b8-aac1184bf945", "content/category/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1931), "Collection", true, "分类管理", "c2e9bdc6-be4d-4c36-ad28-932c0ac71945", "/content/category", 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "277cb688-abaa-4091-8bb1-b86663c220dd", "system/permission/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1922), "Lock", true, "权限管理", "3ea3e877-7c9d-4158-b671-1eac55a7ba48", "/system/permission", 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "2c02a95d-21cc-44df-a572-9b643ecc9966", "tools/monitor/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1950), "Monitor", true, "系统监控", "cfaa92ac-2cac-4c7a-9fac-368f17a8df7e", "/tools/monitor", 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "2dbc5a5b-3d6f-4a76-98f6-9cac30c7a0b4", "content/article/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1929), "Reading", true, "文章列表", "c2e9bdc6-be4d-4c36-ad28-932c0ac71945", "/content/article", 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "368df1ec-0a1b-4b4a-9c8c-9014d00e18bf", "system/role/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1908), "UserFilled", true, "角色管理", "3ea3e877-7c9d-4158-b671-1eac55a7ba48", "/system/role", 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "66b4e109-d861-4608-9ee5-8dd84730bd8b", "statistics/sales/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1943), "Wallet", true, "销售统计", "37a02ef9-23e0-40f6-af12-1d8913ac0d4f", "/statistics/sales", 2, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "9812bcd0-3249-4c01-8dd1-5a09333237c1", "statistics/visit/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1940), "View", true, "访问统计", "37a02ef9-23e0-40f6-af12-1d8913ac0d4f", "/statistics/visit", 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "b09e957b-4da7-4226-91f9-79770bbb9a02", "system/user/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1904), "User", true, "用户管理", "3ea3e877-7c9d-4158-b671-1eac55a7ba48", "/system/user", 1, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) },
                    { "b70f521b-5853-4421-bb9a-54fe4256f144", "content/tag/index", new DateTime(2025, 10, 10, 0, 51, 25, 892, DateTimeKind.Local).AddTicks(1935), "PriceTag", true, "标签管理", "c2e9bdc6-be4d-4c36-ad28-932c0ac71945", "/content/tag", 3, new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified) }
                });
        }
    }
}
